import { createRouter, createWebHistory } from "vue-router";
import type { RouteRecordRaw } from "vue-router";

const routes: RouteRecordRaw[] = [
    {
        path: "/",
        redirect: "/ws",
    },
    {
        path: "/index",
        name: "index",
        component: () => import("@/pages/Page1.vue"),
        meta: {
            keepAlive: true, //设置页面是否需要使用缓存
        },
    },
    {
        path: "/ws",
        name: "index",
        component: () => import("@/pages/UseWs.vue"),
        meta: {
            keepAlive: true, //设置页面是否需要使用缓存
        },
    },

];
const router = createRouter({
    routes: routes,
    history: createWebHistory(),
});

export default router;